<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<th:block th:include="include :: header('商户列表')" />
</head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">

		
			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add(16)">
	                <i class="fa fa-plus"></i> 新增
	            </a>

	        </div>
	        
	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<script th:inline="javascript">
		var prefix = "";
		$(function() {
		    var options = {
		        url: prefix + "/templateController/getTemplatelist",
		        createUrl: prefix + "/templateController/add/{id}",
				createBrandsUrl: prefix + "/templateController/addBrand/{id}",
				queryBrandsUrl: prefix + "/templateController/queryBrands",
				createSpecsUrl: prefix + "/templateController/addSpecs/{id}",
				createAttributeUrl: prefix + "/templateController/addAttribute/{id}",
		        updateUrl: prefix + "/edit/{id}",
		        removeUrl: prefix + "/templateController/removeTemplate/{id}",
		        exportUrl: prefix + "/export",
		        sortName: "businessId",
		        modalName: "模型列表",
		        columns: [{
		            checkbox: true
		        },
				{
					field: 'categoryId',
					title: '分类ID'
				},
		        {
		            field: 'templateName',
		            title: '分类名称'
		        },
		        {
		            field: 'brands',
		            title: '关联品牌信息',
					text: '无内容',
					align: 'center',
					formatter: function(value, row, index) {
						var actions = [];
						actions.push('<a class="btn btn-warning btn-xs " href="javascript:void(0)" onclick="$.operate.addBrand(\'' + row.templateId + '\')"><i class="fa fa-edit"></i>关联品牌</a> ');
						var more = [];
						return actions.join('');
					}
		        },
		        {
		            field: 'attribute',
		            title: '模板扩展属性',
					text: '无内容',
					align: 'center',
					formatter: function(value, row, index) {
						var actions = [];
						actions.push('<a class="btn btn-warning btn-xs " href="javascript:void(0)" onclick="$.operate.addAttribute(\'' + row.templateId + '\')"><i class="fa fa-edit"></i>关联属性</a> ');
						var more = [];
						return actions.join('');
					}
		        },
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		                var actions = [];
		                actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.templateId + '\')"><i class="fa fa-remove"></i>删除</a> ');
		                var more = [];
		                return actions.join('');
		            }
		        }]
		    };
		    $.table.init(options);
		});

	</script>
</body>
</html>